package com.lizicloud.infrastructure.common.exception;

/**
 * 业务异常类
 */
public class BusinessException extends RuntimeException {
    
    private final String code;
    private final Object data;
    
    public BusinessException(String message) {
        super(message);
        this.code = "BUSINESS_ERROR";
        this.data = null;
    }
    
    public BusinessException(String code, String message) {
        super(message);
        this.code = code;
        this.data = null;
    }
    
    public BusinessException(String code, String message, Object data) {
        super(message);
        this.code = code;
        this.data = data;
    }
    
    public String getCode() {
        return code;
    }
    
    public Object getData() {
        return data;
    }
}